<%--
  Created by IntelliJ IDEA.
  User: 戴金睿
  Date: 2022/11/20
  Time: 16:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>EShopManager</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/lib/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/stylesheets/theme.css" />
    <link rel="stylesheet" href=${pageContext.request.contextPath}/static/lib/font-awesome/css/font-awesome.css" />
    <script src="${pageContext.request.contextPath}/static/lib/jquery-1.7.2.min.js" type="text/javascript"></script>


    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height: 300px;
            width: 800px;
            margin: 0px auto;
            margin-top: 1em;
        }

        .brand {
            font-family: georgia, serif;
        }

        .brand .first {
            color: #ccc;
            font-style: italic;
        }

        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>
</head>
<body>

<!-- 顶部页面 -->
<c:import url="top.jsp"></c:import>

<!-- 左边页面 -->
<c:import url="left.jsp"></c:import>

<div class="content">
    <div class="header">
        <h1 class="page-title">订单管理</h1>
    </div>

    <ul class="breadcrumb">
        <li><a href="ordermanager.html">订单管理</a> <span class="divider">/</span></li>
        <li><a href="ordermanager.html">订单列表</a> <span class="divider">/</span></li>
        <li class="active">查看订单信息</li>
    </ul>



    <div class="container-fluid">

        <!-- 基本信息 -->
        <div class="row-fluid">
            <div class="block">
                <a href="#page-basic" class="block-heading" data-toggle="collapse">基本信息</a>
                <div id="page-basic" class="block-body collapse in">
                    <table class="table table-striped table-hover table-bordered">
                        <tbody>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">订单号：</td>
                            <td>${order.orderId} </td>
                            <td style="text-align:right;font-weight:bold;">订单状态：</td>
                            <td>


<%--                                <c:set var="orderInfo" scope="request" >--%>
<%--                                    ${order[0]}--%>
<%--                                </c:set>--%>

                                <c:choose>
                                    <c:when test="${order.status==1 && order.statusPay == 1 && order.statusReceiving == 1 && order.statusSend==1}">
                                        已完成
                                    </c:when>
                                    <c:when test="${order.status==-1}">
                                        <span style="color: red">已取消</span>
                                    </c:when>
                                    <c:when test="${order.status==1}">
                                       正常
                                    </c:when>
                                </c:choose>

                                <c:if test="${order.statusPay==1}">
                                    ,已付款
                                </c:if>
                                <c:if test="${order.statusPay==0}">
                                    ,未付款
                                </c:if>

                                <c:if test="${order.statusSend==1}">
                                    ,已发货
                                </c:if>
                                <c:if test="${order.statusSend==0}">
                                    ,未发货
                                </c:if>

                                <c:if test="${order.statusReceiving==1}">
                                    ,已收货
                                </c:if>
                                <c:if test="${order.statusReceiving==0}">
                                    ,未收货
                                </c:if>

                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">购货人：</td>
                            <td>${order.tbUserInfo.userName}</td>
                            <td style="text-align:right;font-weight:bold;">下单时间：</td>
                            <td>${order.orderDate}</td>
                        </tr>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">支付方式：</td>
                            <td>网银在线</td>
                            <td style="text-align:right;font-weight:bold;">付款时间：</td>
                            <td>${order.timePay}</td>
                        </tr>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">发货单号：</td>
                            <td>${order.shipmentsNo}</td>
                            <td style="text-align:right;font-weight:bold;">发货时间：</td>
                            <td>${order.timeShipments}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!-- 收货人信息 -->
        <div class="row-fluid">
            <div class="block">
                <a href="#page-address" class="block-heading" data-toggle="collapse">收货人信息</a>
                <div id="page-address" class="block-body collapse in">
                    <table class="table table-striped table-hover table-bordered">
                        <tbody>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">收货人：</td>
                            <td>${order.person}</td>
                            <td style="text-align:right;font-weight:bold;">电话：</td>
                            <td>${order.phone}</td>
                        </tr>
                        <tr>
                            <td style="text-align:right;font-weight:bold;">地址：</td>
                            <td colspan="3">${order.address}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!-- 商品信息 -->
        <div class="row-fluid">
            <div class="block">
                <a href="#page-goods-list" class="block-heading" data-toggle="collapse">商品信息</a>
                <div id="page-goods-list" class="block-body collapse in">
                    <table class="table table-striped table-hover table-bordered">
                        <thead>
                        <tr>
                            <th>商品名称</th>
                            <th>价格</th>
                            <th>数量</th>
                            <th>库存</th>
                            <th>小计</th>
                        </tr>
                        </thead>

                        <tbody>

                        <c:forEach items="${goods}" var="good">
                        <tr>
                            <td>
                                <a href="#" target="_blank">${good.book_name}</a>
                            </td>
                            <td>${good.book_price}</td>
                            <td>${good.num}</td>
                            <td>${good.store_count}</td>
                            <td>${good.totalPrice}</td>
                        </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!-- 费用信息 -->
        <div class="row-fluid">
            <div class="block">
                <a href="#page-money" class="block-heading" data-toggle="collapse">费用信息</a>
                <div id="page-money" class="block-body collapse in">
                    <div class="search-well">
                        <form  class="form-inline" role="search"
                               action="#" method="post">
                            <strong>商品总金额：${totalMoney} </strong><br />
                            <strong>运费：包邮</strong><br />
                            <strong style="color: red">总计：${totalMoney} </strong>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <!-- 可执行操作 -->
        <div class="row-fluid">
            <div class="block">
                <a href="#page-filter" class="block-heading" data-toggle="collapse">当前可执行操作</a>
                <div id="page-filter" class="block-body collapse in">
                    <div class="search-well">
                        <form  class="form-inline" role="search"
                               action="#" method="post">


                            <!-- 已取消 -->
                            <button type="submit" class="btn btn-default">删除订单</button>



                            <!-- 待付款 -->
                            <button type="submit" class="btn btn-default">设置为已付款</button>
                            <button type="submit" class="btn btn-default">取消订单</button>

                            <!-- 待发货 -->
                            <button type="button" class="btn btn-default" onclick="javascript:location.href='${pageContext.request.contextPath }/orders/infoenter.action?order_id=${orderInfo.order_id }';">发货</button>
                            <button type="submit" class="btn btn-default">设置为未付款</button>
                            <button type="submit" class="btn btn-default">取消订单</button>

                            <!-- 待收货 -->
                            <button type="submit" class="btn btn-default">设置为未付款</button>
                            <button type="submit" class="btn btn-default">取消订单</button>

                            <!-- 已完成 -->
                            <button type="submit" class="btn btn-default">取消订单</button>


                        </form>
                    </div>

                    <table class="table table-striped table-hover table-bordered">
                        <thead>
                        <tr>
                            <th>操作者</th>
                            <th>操作时间</th>
                            <th>订单状态</th>
                            <th>付款状态</th>
                            <th>发货状态</th>
                        </tr>
                        </thead>

                        <tbody>
                        <c:forEach items="${userOrderMap}" var="user">
                            <tr>
                                <td>${user.user_name}</td>
                                <td>${user.log_date}</td>
                                <td>${user.status}</td>
                                <td>${user.status_pay}</td>
                                <td>${user.status_send}</td>
                            </tr>
                        </c:forEach>

                        </tbody>
                    </table>

                </div>
            </div>
        </div>

        <!-- 底部页面 -->
<c:import url="footer.jsp"></c:import>
    </div>

</div>


<script src="${pageContext.request.contextPath }/static/lib/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/lib/tooltips.js"></script>

<script type="text/javascript">


</script>

</body>
</html>

